package ru.pb.game.network.engine;

import ru.pb.game.network.clients.GameClient;
import ru.pb.game.network.threading.ThreadPoolManager;
import ru.pb.global.network.engine.NioService;
import ru.pb.global.network.engine.NioSession;
import ru.pb.global.network.engine.core.interfaces.IClientFactory;
import ru.pb.global.network.engine.core.interfaces.IPacketExecutor;
import ru.pb.global.network.engine.packets.Packet;

public class ClientFactory implements IPacketExecutor, IClientFactory<GameClient>
{
	@Override
	public GameClient create(NioSession<GameClient> session, NioService<GameClient> authServerClientNioService, IPacketExecutor ex)
	{
		return new GameClient(session, authServerClientNioService, ex);
	}

	@Override
	public void executePacket(Packet run)
	{
		ThreadPoolManager.getInstance().execute(run);
	}
}
